<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QAnimationGroup Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAnimationGroup Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QAnimationGroup class is an abstract base class for groups
of animations. <a href="#details">More...</a></p>

<p>Inherits <a href="qabstractanimation.html">QAbstractAnimation</a>.</p><p>Inherited by <a href="qparallelanimationgroup.html">QParallelAnimationGroup</a> and <a href="qsequentialanimationgroup.html">QSequentialAnimationGroup</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qanimationgroup.html#QAnimationGroup">__init__</a></b> (<i>self</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qanimationgroup.html#addAnimation">addAnimation</a></b> (<i>self</i>, QAbstractAnimation&#160;<i>animation</i>)</li><li><div class="fn" />QAbstractAnimation <b><a href="qanimationgroup.html#animationAt">animationAt</a></b> (<i>self</i>, int&#160;<i>index</i>)</li><li><div class="fn" />int <b><a href="qanimationgroup.html#animationCount">animationCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qanimationgroup.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qanimationgroup.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />int <b><a href="qanimationgroup.html#indexOfAnimation">indexOfAnimation</a></b> (<i>self</i>, QAbstractAnimation&#160;<i>animation</i>)</li><li><div class="fn" /><b><a href="qanimationgroup.html#insertAnimation">insertAnimation</a></b> (<i>self</i>, int&#160;<i>index</i>, QAbstractAnimation&#160;<i>animation</i>)</li><li><div class="fn" /><b><a href="qanimationgroup.html#removeAnimation">removeAnimation</a></b> (<i>self</i>, QAbstractAnimation&#160;<i>animation</i>)</li><li><div class="fn" />QAbstractAnimation <b><a href="qanimationgroup.html#takeAnimation">takeAnimation</a></b> (<i>self</i>, int&#160;<i>index</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAnimationGroup class is an abstract base class for groups
of animations.</p>
<p>An animation group is a container for animations (subclasses of
<a href="qabstractanimation.html">QAbstractAnimation</a>). A group
is usually responsible for managing the <a href="qabstractanimation.html#State-enum">state</a> of its animations,
i.e., it decides when to start, stop, resume, and pause them.
Currently, Qt provides two such groups: <a href="qparallelanimationgroup.html">QParallelAnimationGroup</a> and
<a href="qsequentialanimationgroup.html">QSequentialAnimationGroup</a>.
Look up their class descriptions for details.</p>
<p>Since QAnimationGroup inherits from <a href="qabstractanimation.html">QAbstractAnimation</a>, you can combine
groups, and easily construct complex animation graphs. You can
query <a href="qabstractanimation.html">QAbstractAnimation</a> for
the group it belongs to (using the <a href="qabstractanimation.html#group">group()</a> function).</p>
<p>To start a top-level animation group, you simply use the
<a href="qabstractanimation.html#start">start()</a> function from
<a href="qabstractanimation.html">QAbstractAnimation</a>. By a
top-level animation group, we think of a group that itself is not
contained within another group. Starting sub groups directly is not
supported, and may lead to unexpected behavior.</p>
<p>QAnimationGroup provides methods for adding and retrieving
animations. Besides that, you can remove animations by calling
remove(), and clear the animation group by calling <a href="qanimationgroup.html#clear">clear</a>(). You may keep track of
changes in the group's animations by listening to <a href="qevent.html#Type-enum">QEvent.ChildAdded</a> and <a href="qevent.html#Type-enum">QEvent.ChildRemoved</a> events.</p>
<p>QAnimationGroup takes ownership of the animations it manages,
and ensures that they are deleted when the animation group is
deleted.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAnimationGroup" />QAnimationGroup.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qanimationgroup.html">QAnimationGroup</a>.
<i>parent</i> is passed to <a href="qobject.html">QObject</a>'s
constructor.</p>


<h3 class="fn"><a name="addAnimation" />QAnimationGroup.addAnimation (<i>self</i>, <a href="qabstractanimation.html">QAbstractAnimation</a>&#160;<i>animation</i>)</h3><p>The <i>animation</i> argument has it's ownership transferred to Qt.</p><p>Adds <i>animation</i> to this group. This will call
insertAnimation with index equals to <a href="qanimationgroup.html#animationCount">animationCount</a>().</p>
<p><b>Note:</b> The group takes ownership of the animation.</p>
<p><b>See also</b> <a href="qanimationgroup.html#removeAnimation">removeAnimation</a>().</p>


<h3 class="fn"><a name="animationAt" /><a href="qabstractanimation.html">QAbstractAnimation</a> QAnimationGroup.animationAt (<i>self</i>, int&#160;<i>index</i>)</h3><p>Returns a pointer to the animation at <i>index</i> in this
group. This function is useful when you need access to a particular
animation. <i>index</i> is between 0 and <a href="qanimationgroup.html#animationCount">animationCount</a>() - 1.</p>
<p><b>See also</b> <a href="qanimationgroup.html#animationCount">animationCount</a>() and
<a href="qanimationgroup.html#indexOfAnimation">indexOfAnimation</a>().</p>


<h3 class="fn"><a name="animationCount" />int QAnimationGroup.animationCount (<i>self</i>)</h3><p>Returns the number of animations managed by this group.</p>
<p><b>See also</b> <a href="qanimationgroup.html#indexOfAnimation">indexOfAnimation</a>(),
<a href="qanimationgroup.html#addAnimation">addAnimation</a>(), and
<a href="qanimationgroup.html#animationAt">animationAt</a>().</p>


<h3 class="fn"><a name="clear" />QAnimationGroup.clear (<i>self</i>)</h3><p>Removes and deletes all animations in this animation group, and
resets the current time to 0.</p>
<p><b>See also</b> <a href="qanimationgroup.html#addAnimation">addAnimation</a>() and <a href="qanimationgroup.html#removeAnimation">removeAnimation</a>().</p>


<h3 class="fn"><a name="event" />bool QAnimationGroup.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="indexOfAnimation" />int QAnimationGroup.indexOfAnimation (<i>self</i>, <a href="qabstractanimation.html">QAbstractAnimation</a>&#160;<i>animation</i>)</h3><p>Returns the index of <i>animation</i>. The returned index can be
passed to the other functions that take an index as an
argument.</p>
<p><b>See also</b> <a href="qanimationgroup.html#insertAnimation">insertAnimation</a>(),
<a href="qanimationgroup.html#animationAt">animationAt</a>(), and
<a href="qanimationgroup.html#takeAnimation">takeAnimation</a>().</p>


<h3 class="fn"><a name="insertAnimation" />QAnimationGroup.insertAnimation (<i>self</i>, int&#160;<i>index</i>, <a href="qabstractanimation.html">QAbstractAnimation</a>&#160;<i>animation</i>)</h3><p>The <i>animation</i> argument has it's ownership transferred to Qt.</p><p>Inserts <i>animation</i> into this animation group at
<i>index</i>. If <i>index</i> is 0 the animation is inserted at the
beginning. If <i>index</i> is <a href="qanimationgroup.html#animationCount">animationCount</a>(), the
animation is inserted at the end.</p>
<p><b>Note:</b> The group takes ownership of the animation.</p>
<p><b>See also</b> <a href="qanimationgroup.html#takeAnimation">takeAnimation</a>(), <a href="qanimationgroup.html#addAnimation">addAnimation</a>(), <a href="qanimationgroup.html#indexOfAnimation">indexOfAnimation</a>(), and
<a href="qanimationgroup.html#removeAnimation">removeAnimation</a>().</p>


<h3 class="fn"><a name="removeAnimation" />QAnimationGroup.removeAnimation (<i>self</i>, <a href="qabstractanimation.html">QAbstractAnimation</a>&#160;<i>animation</i>)</h3><p>The <i>animation</i> argument</p><p>Removes <i>animation</i> from this group. The ownership of
<i>animation</i> is transferred to the caller.</p>
<p><b>See also</b> <a href="qanimationgroup.html#takeAnimation">takeAnimation</a>(), <a href="qanimationgroup.html#insertAnimation">insertAnimation</a>(), and
<a href="qanimationgroup.html#addAnimation">addAnimation</a>().</p>


<h3 class="fn"><a name="takeAnimation" /><a href="qabstractanimation.html">QAbstractAnimation</a> QAnimationGroup.takeAnimation (<i>self</i>, int&#160;<i>index</i>)</h3><p>The <i>QAbstractAnimation</i> result</p><p>Returns the animation at <i>index</i> and removes it from the
animation group.</p>
<p><b>Note:</b> The ownership of the animation is transferred to
the caller.</p>
<p><b>See also</b> <a href="qanimationgroup.html#removeAnimation">removeAnimation</a>(),
<a href="qanimationgroup.html#addAnimation">addAnimation</a>(),
<a href="qanimationgroup.html#insertAnimation">insertAnimation</a>(), and
<a href="qanimationgroup.html#indexOfAnimation">indexOfAnimation</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>